package com.javaxxf.controller;
import com.javaxxf.config.SpringConfig;
import com.javaxxf.pojo.User;
import com.javaxxf.service.UserService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author xuxiaofei
 * @date 2021年09月30日下午12:45
 * @联系作者：如果你有什么不懂，可以加作者微信 xxf960513 一起交流学习
 */



public class UserController {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
        UserService userService = (UserService) ctx.getBean("userService");
        User user = userService.findById(1);
        System.out.println(user.getName());
        System.out.println(user.getPassword());
    }
}








